<template>
	<view>
		<view class="tabbarHade">
			<img src="/static/images/jiankong.png" alt="" />
			<view class="">
				监控设备
			</view>
		</view>
		<view class="box">
			<view class="item" v-for="(item,index) in listData" :key="index">
				<view class="left">
					<text>芯片机器-设备{{item.robot}}</text>
					<text>地址：{{item.address[0]}}号楼-{{item.address[1]}}车间-{{item.address[2]}}设备 </text>
					<text>监测数值：1257895</text>
					<text>IP地址：192.168.5.101</text>
				</view>
				<view class="right">
					<view v-if="item.state==true" :class="item.state==true?'right_red':''">
						在线
					</view>
					<view v-if="item.state==false" :class="item.state==false?'right_blue':''">
						离线
					</view>
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				listData: [{
						robot: 1,
						state: false,
						address: [1, , 1, 201],
						number: 1257895,
						ip: '192.168.5.101'
					},
					{
						robot: 2,
						state: true,
						address: [1, , 1, 201],
						number: 1257895,
						ip: '192.168.5.101'
					},
					{
						robot: 3,
						state: true,
						address: [1, , 1, 201],
						number: 1257895,
						ip: '192.168.5.101'
					},
					{
						robot: 4,
						state: false,
						address: [1, , 1, 201],
						number: 1257895,
						ip: '192.168.5.101'
					},
					{
						robot: 5,
						state: true,
						address: [1, , 1, 201],
						number: 1257895,
						ip: '192.168.5.101'
					},
					{
						robot: 6,
						state: true,
						address: [1, , 1, 201],
						number: 1257895,
						ip: '192.168.5.101'
					},
					{
						robot: 7,
						state: false,
						address: [1, , 1, 201],
						number: 1257895,
						ip: '192.168.5.101'
					},
					{
						robot: 8,
						state: true,
						address: [1, , 1, 103],
						number: 1257895,
						ip: '192.168.5.101'
					},
				]
			}
		},
		methods: {

		},
		onShow() {

		}
	}
</script>

<style lang="scss" scoped>
	.tabbarHade {
		background-color: #5479FF;
		display: flex;
		flex-direction: row;
		align-items: center;
		color: #fff;

		img {
			width: 100rpx;
		}
	}

	.box {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 40rpx;

		.item {
			width: 100%;
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			margin-bottom: 20rpx;
			box-shadow: 5px 5px 50px 0px rgba(206, 207, 219, 1);
			padding: 20rpx;
			border-radius: 10rpx;
			box-sizing: border-box;

			.left {
				display: flex;
				flex-direction: column;

			}

			.right {
				width: 100rpx;
				height: 50rpx;
					view{
						text-align: center;
						border-radius: 20rpx;
						color: #fff;
					}
				.right_red {
					background-color: #f00;
				}

				.right_blue {
					background-color: #00f;
				}
			}

		}
	}
</style>